<?php
require_once 'Zend/Registry.php';
require_once 'headerHelper.php';
require_once 'application/library/config/gcConfigRegistry.php';
require_once 'application/constant/constant.php';

/**
 * configHelper
 * @author    Soochow University
 * @version   1.0
 * @exclude   作  成  日：2011/04/07
 */
class configHelper{

    /**
     * 取得主机服务器
     * getHostServer
     * @return  string  $host
     */
    public static function getHostServer(){
        $config=gcConfigRegistry::getZend(sysConstant::SAVE_DOMAIN_CONFIG);
        $host = $config["hostServer"] . headerHelper::getSSId();
        return $host;
    }

    /**
     * 取得图片服务器
     * getPictureServer
     * @return  string  $config["pictureServer"]
     */
    public static function getPictureServer(){
        $config=gcConfigRegistry::getZend(sysConstant::SAVE_DOMAIN_CONFIG);
        return $config["pictureServer"];
    }

    /**
     * 取得public路径
     * getHostServerPublic
     * @return  string  $config["pictureServer"]
     */
    public static function getHostServerPublic(){
        $config=gcConfigRegistry::getZend(sysConstant::SAVE_DOMAIN_CONFIG);
        return $config["hostServerPublic"];
    }

    /**
     * 取得本地语言
     * getLocalLanguage
     * @return  string  $config["localLanguage"]
     */
    public static function getLocalLanguage(){
        $config=gcConfigRegistry::getZend(sysConstant::APPCONFIG_SYS);
        return $config["localLanguage"];
    }
    
    /**
     * 取得默认主题
     * getDefaultTheme
     * @return  string  $config["defaultTheme"]
     */
    public static function getDefaultTheme(){
        $config=gcConfigRegistry::getZend(sysConstant::APPCONFIG_SYS);
        return $config["defaultTheme"];
    }

    /**
     * 取得系统上传制限
     * getSysUploadMax
     * @return  string  $config["sysUploadMax"]
     */
    public static function getSysUploadMax(){
        $config=gcConfigRegistry::getZend(sysConstant::APPCONFIG_SYS);
        return $config["sysUploadMax"];
    }

    /**
     * 取得乱序密钥路径
     * getAesKey
     * @return  string  $config["aesKey"]
     */
    public static function getAesKey(){
        $config=gcConfigRegistry::getZend(sysConstant::APPCONFIG_SYS);
        return $config["aesKey"];
    }

    /**
     * 取得访问许可URL
     * getUriIntercept
     * @return  string
     */
    public static function getUriIntercept(){
        return gcConfigRegistry::getZend(sysConstant::URI_INTERCEPT);
    }

    /**
     * 取得SmartyTemplate目录
     * getSmartyTemplateDir
     * @return  string
     */
    public static function getSmartyTemplateDir(){
        $config=gcConfigRegistry::getZend(sysConstant::SMARTY);
        return $config["templateDir"];
    }

    /**
     * 取得SmartyTemplateCompile目录
     * getSmartyCompileDir
     * @return  string
     */
    public static function getSmartyCompileDir(){
        $config=gcConfigRegistry::getZend(sysConstant::SMARTY);
        return $config["compileDir"];
    }

    /**
     * 取得全局变量
     * getGlobalVariable
     * @return  array
     */
    public static function getGlobalVariable($key){
        $config=gcConfigRegistry::getZend(sysConstant::VARIABLE);
        return $config[$key];
    }

    /**
     * 取得邮件配置
     * getMailConfig
     * @return  array   $mailData
     */
    public static function getMailConfig(){
        $mailData=gcConfigRegistry::getZend(sysConstant::MAIL);
        return $mailData;
    }

    /**
     * alipay连接用
     * getEconTimeout
     * @return  string  $econTimeout["timeout"]
     */
    public static function getEconTimeout(){
        $econTimeout=gcConfigRegistry::get(sysConstant::ECON);
        return $econTimeout["timeout"];
    }

    /**
     * alipay连接用
     * getEconUrl
     * @return  string  $econTimeout["timeout"]
     */
    public static function getEconUrl(){
        $econUrl=gcConfigRegistry::get(sysConstant::ECON);
        return $econUrl["url"];
    }

    /**
     * 取得FTP服务主机
     * getFtvSvr
     * @return  string  $ftvSvr
     */
    public static function getFtvSvr(){
        $ftvSvr=gcConfigRegistry::get(sysConstant::FTPSVR);
        return $ftvSvr;
    }
}